package api

import (
	"github.com/gin-gonic/gin"
	"product-announcement/api/handler"
)

func LoadRouter(r *gin.Engine) {

	api := r.Group("/api")
	{
		user := api.Group("/user")
		{
			user.POST("register", handler.RegisterUser)
			user.POST("login", handler.LoginUser)
		}
		announcement := api.Group("/announcement")
		{
			announcement.POST("add", handler.AddAnnouncement)
			announcement.POST("add", handler.ListAnnouncement)
		}
		order := api.Group("/order")
		{
			order.POST("/create", handler.CreateOrder)
			order.POST("/list", handler.ListOrder)
		}
	}

}
